package com.ruoyi.school.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.school.mapper.JobMapper;
import com.ruoyi.school.domain.Job;
import com.ruoyi.school.service.IJobService;

/**
 * jobService业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-31
 */
@Service
public class JobServiceImpl implements IJobService 
{
    @Autowired
    private JobMapper jobMapper;

    /**
     * 查询job
     * 
     * @param id job主键
     * @return job
     */
    @Override
    public Job selectJobById(Integer id)
    {
        return jobMapper.selectJobById(id);
    }

    /**
     * 查询job列表
     * 
     * @param job job
     * @return job
     */
    @Override
    public List<Job> selectJobList(Job job)
    {
        return jobMapper.selectJobList(job);
    }

    /**
     * 新增job
     * 
     * @param job job
     * @return 结果
     */
    @Override
    public int insertJob(Job job)
    {
        job.setCreateTime(DateUtils.getNowDate());
        return jobMapper.insertJob(job);
    }

    /**
     * 修改job
     * 
     * @param job job
     * @return 结果
     */
    @Override
    public int updateJob(Job job)
    {
        job.setUpdateTime(DateUtils.getNowDate());
        return jobMapper.updateJob(job);
    }

    /**
     * 批量删除job
     * 
     * @param ids 需要删除的job主键
     * @return 结果
     */
    @Override
    public int deleteJobByIds(Integer[] ids)
    {
        return jobMapper.deleteJobByIds(ids);
    }

    /**
     * 删除job信息
     * 
     * @param id job主键
     * @return 结果
     */
    @Override
    public int deleteJobById(Integer id)
    {
        return jobMapper.deleteJobById(id);
    }
}
